package com.youyi.flymewallpager.apdater;

import android.content.Context;
import android.support.v7.widget.AppCompatTextView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.youyi.flymewallpager.R;
import com.youyi.flymewallpager.entity.WallPager;

import butterknife.BindView;

/**
 * Created by xzp on 16/7/6.
 */
public class WallPagerAdapter extends BaseRecyclerAdapter<WallPager>{
    public WallPagerAdapter(Context context) {
        super(context);
    }

    @Override
    public RecyclerView.ViewHolder onCreateCustomViewHolder(ViewGroup parent, int viewType) {
        return new WallPagerHolder(LayoutInflater.from(getContext()).inflate(R.layout.wall_pager_item,parent,false));
    }

    @Override
    public void onBindCustomViewHolder(RecyclerView.ViewHolder holder, int position) {
        WallPagerHolder wallPagerHolder= (WallPagerHolder) holder;
        WallPager wallPager=getList().get(position);
        wallPagerHolder.nameText.setText(wallPager.getName());
    }
    public final class WallPagerHolder extends BaseViewHolder{
        @BindView(R.id.wall_pager_name_text)
        AppCompatTextView nameText;
        public WallPagerHolder(View itemView) {
            super(itemView);
        }
    }
}
